package com.power.using.mydaggerp.model.book;

import android.support.annotation.NonNull;

import com.power.using.mydaggerp.api.DoubanApi;
import com.power.using.mydaggerp.base.BaseModel;
import com.power.using.mydaggerp.contract.detail.BookDeatilContract;
import com.power.using.mydaggerp.model.bean.douban.book.BookDetailBean;
import com.zyw.horrarndoo.sdk.helper.RetrofitCreateHelper;
import com.zyw.horrarndoo.sdk.helper.RxHelper;

import io.reactivex.Observable;

/**
 * Created by 聪明一只哈 on 2019/10/18.
 * Time: 2019/10/18  10:39
 */
public class BookDetailModel extends BaseModel implements BookDeatilContract.IBookDetailModel{

    @NonNull
    public static BookDetailModel newInstance() {
        return new BookDetailModel();
    }


    @Override
    public Observable<BookDetailBean> getBookDetail(String id) {
        return RetrofitCreateHelper.createApi(DoubanApi.class,DoubanApi.HOST).getBookDetail(id)
                .compose(RxHelper.<BookDetailBean>rxSchedulerHelper());
    }
}
